package com.StarStudio.Service;

import com.ruoyi.common.core.Entity.CouponsStock;
import com.ruoyi.common.core.Entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Service
@FeignClient(value = "CouponsStock")
public interface CouponsStockService {


    @RequestMapping("/UnsoldItems/{couponsId}/{flag}")
    List<CouponsStock> findUnsoldItems(@PathVariable(value = "couponsId") long couponsId, @PathVariable(value = "flag") boolean flag);

    @PutMapping("/put")
    Result updateCouponsStock(@RequestBody CouponsStock couponsStock);

    @RequestMapping("/SoldItems/{couponsId}/{flag}")
    List<CouponsStock> findSoldItems(@PathVariable(value = "couponsId") long couponsId, @PathVariable(value = "flag") boolean flag);

    @RequestMapping("/findByOrderId/{orderId}")
    List<CouponsStock> findByOrder_id(@PathVariable(value = "orderId") long orderId);



}
